// 例子10

{
    let {bar, foo, baz} = {foo: 'a', bar: 'b'};
    console.log(bar, foo, baz); // "b" "a" undefined
}

console.log('----------------------------------')

{
    let {foo: baz} = {foo: 'a', bar: 'b'};
    console.log(baz); // "a"

    let obj = {first: 'hello', last: 'world'};
    let {first: f, last: g} = obj;
    console.log(f, g); // "hello" "world"
}

console.log('----------------------------------')

let obj = {
    p: [
        'hello',
        {y: 'world'}
    ]
};
let {p, p:[x, {y}]} = obj;
console.log(p, x, y); // ["hello", {y: "world"}] "hello" "world"

console.log('----------------------------------')

const node = {
    loc: {
        start: {
            line: 1,
            column: 5
        }
    }
};
let { loc, loc: { start }, loc: { start: { line }} } = node;
console.log(line, loc, start); //1 {start: {line:1, column}} {line:1, column:5}
